package mysql

import "github.com/astaxie/beego/orm"

type Physical struct {
	Id         int    `orm:"Column(Id)"`
	StoreId    string `orm:"Column(StoreId)"`
	Name       string `orm:"Column(Name)"`
	ZoneTypeId string `orm:"Column(ZoneTypeId)"`
	Enable     int    `orm:"Column(Enable)"`
}

func (p *Physical) TableName() string {
	return PhysicalTBName()
}

func InsertPhysical(p *Physical) (int64, error) {
	o := orm.NewOrm()
	return o.Insert(p)
}

type RPhysicalZone struct {
	Id             int    `orm:"Column(Id)"`
	PhysicalzoneId int    `orm:"Column(PhysicalzoneId)"`
	ZoneId         int    `orm:"Column(ZoneId)"`
	Reverse        int    `orm:"Column(Reverse)"`
	DeviceType     string `orm:"Column(DeviceType)"`
}

func (p *RPhysicalZone) TableName() string {
	return RPhysicalZoneTBName()
}

func InsertRPhysicalZone(rpz *RPhysicalZone) (int64, error) {
	o := orm.NewOrm()
	return o.InsertOrUpdate(rpz)
}
